import DataBus from './databus.js'

let databus = new DataBus()

export default class Block  {
  constructor(onelinecount = 0, x = 0, y = 0, color = 'red', src = '') {
    this.x = x
    this.y = y
    this.width = canvas.width / onelinecount
    this.height = canvas.width / onelinecount
    this.color = color
    this.src = src

    // 构造完每个 block 之后，放入 databus 中
    databus.block.push(this)
  }

}
